<template>
  <div>
    <div class="item" v-for="(item, index) of list" :key="index">
      <div class="item-title">
        <span class="item-title-icon">{{item.title}}</span>
      </div>
      <div class="item-content-price-icon" @click="handlePay">
        <span class="item-content-icon">{{item.content}}</span>
        <span class="item-price-icon">{{'¥'+item.price}}</span>
      </div>
      <div v-if="item.children">
        <detail-list :list='item.children' class="item-children"></detail-list>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'DetailList',
  props: {
    list: Array
  },
  methods: {
    handlePay () {
      this.$router.push('/pay')
    }
  }
}
</script>
<style lang='stylus' scoped>
  @import '~styles/varibles.styl';
  @import '~styles/mixins.styl';
  .item-title-icon
    // display: inline-block
    position: relative
    width: .36rem
    height: .36rem
    background: url(http://s.qunarzz.com/piao/image/touch/sight/detail.png) 0 -.45rem no-repeat
    margin-right: .1rem
    padding-left: .4rem
    background-size: .4rem 3rem
  .item-content-price-icon
    position: relative
    border-bottom: .01rem solid #ccc
    .item-content-icon
      display: inline-block
      margin-right: 1.5rem
      margin-left: .2rem
      color: #333
      width: 70%
      font-size: .3rem
      line-height: .48rem
    .item-price-icon
      display: inline-block
      position: absolute
      top: 0
      right: .46rem;
      color: #ff9800;
      font-size: .4rem;
  .item-title
    line-height: .8rem
    font-size: .32rem
    padding: 0 .2rem
  .item-children
    padding: 0 .2rem
</style>
